package com.htu.model.impl;

import com.htu.domain.Cart;
import com.htu.model.ICartModel;
import com.htu.service.ICartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CartModelImpl implements ICartModel
{
    @Autowired
    private ICartService service;

    @Override
    public List<Cart> queryCartById(int id)
    {
        return service.queryCartById(id);
    }

    @Override
    public boolean doUpdateCart(int id,String name,int count)
    {
        return service.doUpdateCart( id, name, count);
    }

    @Override
    public boolean doCartDelete(int id, String name)
    {
        return service.doCartDelete(id,  name);
    }

    @Override
    public boolean doCartInsert(Cart cart)
    {
        return service.doCartInsert(cart);
    }
}
